import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex);
export default new Vuex.Store({
    state: {
        status: 0,
        // 登录状态 1登录  0退出
        img: "../../static/head/head2.jpg",
        // 头像
        name: "weijun",
        // 用户姓名
        shopnum: "1",
        // 购物车数量
        UserID: "1",
        // 用户id
        Usersex: "女",
        // 用户性别
        phone: "123456",
        // 手机号
        birthday: "2021-04-07",
        // 用户生日

    },
    mutations: {
        changestatus(state, val) {
            return state.status = val
        },
        changeimg(state, val) {
            return state.img = val
        },
        changename(state, val) {
            return state.name = val
        },
        changeshopnum(state, val) {
            return state.shopnum = val
        },
        changeUserID(state, val) {
            return state.UserID = val
        },
        changeUsersex(state, val) {
            return state.Usersex = val
        },
        changephone(state, val) {
            return state.phone = val
        },
        changebirthday(state, val) {
            return state.birthday = val
        },
    },
    // getters: {
    //     add(state) {
    //         return state.num + state.num1
    //     }
    // }
})